package com.hongruan.service.impl;

import java.util.List;

import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hongruan.bean.Account;
import com.hongruan.service.AccountService;
import com.hongruan.service.BaseService;

@Service
@Transactional
public class AccountServiceImpl extends BaseService implements AccountService {

	public Account read(Account account) {
		List<Account> accountList = this.accountDao.read(account);
		if(CollectionUtils.isNotEmpty(accountList)){
			return accountList.get(0);
		}else{
			return null;
		}
	}

	public List<Account> accountList(Account account) {
		return this.accountDao.accountList(account);
	}

	public void create(Account account) {
		this.accountDao.create(account);
	}

	public Account read(Long id) {
		return this.accountDao.read(id);
	}

	public void update(Account account) {
		this.accountDao.update(account);
	}

}
